<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:include="include :: appHeader"></head>
<body ontouchstart>
<!--首页 tabbar -->
<div class="weui-tab">
    <div class="weui-tab__bd">
        <div id="tab3" class="weui-tab__bd-item  weui-tab__bd-item--active">
            <div class="weui-btn-area"
                 onclick="popRecSearchPanel()"
                 style="border: #6d6d72 1px solid;
                        margin-left: 2px;
                        margin-right: 2px;
                        padding-left: 4px;
                        padding-right: 4px;">
                <input readonly="readonly"
                       type="search"
                       placeholder="搜索"
                       style="height: 35px;
                              font-size: 23px;
                              border: 0;
                              outline: none;
                              background-color: rgba(0, 0, 0, 0);"/>
                <img width="20px"
                     th:src="@{/img/magnifier.png}"/>
            </div>
            <h1 th:if="${#lists.isEmpty(hisRec)}" style="margin-top: 64px;text-align: center">查无记录</h1>
            <div id="his-apply-list" class='demos-content-padded' th:unless="${#lists.isEmpty(hisRec)}">
                <div class="weui-form-preview__hd" th:each="ha : ${hisRec}">
                    <div class="weui-form-preview__item">
                        <b class="weui-form-preview__label">卡类型</b>
                        <b class="weui-form-preview__item" th:text="${ha.type} == 1?'制作件':(${ha.type} == 2?'装配件':(${ha.type} == 3?'返修票':''))"></b>
                    </div>
                    <div class="weui-form-preview__item">
                        <b class="weui-form-preview__label">生产令号</b>
                        <b class="weui-form-preview__item" th:text="${ha.prodNo}"></b>
                    </div>
                    <div class="weui-form-preview__item">
                        <b class="weui-form-preview__label">图号</b>
                        <b class="weui-form-preview__item" th:text="${ha.drawNo}"></b>
                    </div>
                    <div class="weui-form-preview__item">
                        <b class="weui-form-preview__label">零件名称</b>
                        <b class="weui-form-preview__item" th:text="${ha.drawName}"></b>
                    </div>
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">工艺路线</label>
                        <b class="weui-form-preview__item" th:text="${ha.route}"></b>
                    </div>
                    <div class="weui-form-preview__item">
                        <label class="weui-form-preview__label">申请数量</label>
                        <b class="weui-form-preview__item" th:text="${ha.num}"></b>
                    </div>
                    <div class="weui-form-preview__ft" th:if="${ha.status == 3} and ${ha.nextApplyNum == 0}">
                        <button type="button" class="weui-form-preview__btn weui-form-preview__btn_primary"
                                th:onclick="|cancelRec(${ha.id},${ha.type})|">撤销接收
                        </button>
                    </div>
                </div>
            </div>
            <div style="height: 70px"></div>
        </div>
    </div>

    <div class="weui-tabbar">
        <a th:href="@{/index}" class="weui-tabbar__item weui-bar__item--on">
            <div class="weui-tabbar__icon">
                <img th:src="@{/img/me.png}" alt="">
            </div>
            <p class="weui-tabbar__label">我的信息</p>
        </a>
        <!--生产历史-->
        <a th:if="${#strings.contains(session.user.roles,'【申请质检】')}" th:href="@{/hisApply/null/null}" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img th:src="@{/img/his_apply.png}" alt="">
            </div>
            <p class="weui-tabbar__label">历史申请</p>
        </a>
<!--        <a th:if="${#strings.contains(session.user.roles,'【转序接收】')}" th:href="@{/hisRec/null/null}" class="weui-tabbar__item">-->
<!--            <div class="weui-tabbar__icon">-->
<!--                <img th:src="@{/img/his_rec.png}" alt="">-->
<!--            </div>-->
<!--            <p class="weui-tabbar__label">历史接收</p>-->
<!--        </a>-->
        <a th:if="${#strings.contains(session.user.roles,'【转序质检】')}" th:href="@{/hisCheck/null/null}" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img th:src="@{/img/his_check.png}" alt="">
            </div>
            <p class="weui-tabbar__label">历史质检</p>
        </a>
        <a th:if="${#strings.contains(session.user.roles,'【入库质检】')}" onclick="tips()" href="javascript:void(0)" class="weui-tabbar__item">
            <div class="weui-tabbar__icon">
                <img th:src="@{/img/his_check.png}" alt="">
            </div>
            <p class="weui-tabbar__label">入库历史质检</p>
        </a>
    </div>
</div>

<div id="pop-query" class="weui-popup__container popup-bottom">
    <div class="weui-popup__overlay"></div>
    <div class="weui-popup__modal">
        <div class="toolbar">
            <div class="toolbar-inner">
                <a href="javascript:void(0);" class="picker-button close-popup">关闭</a>
                <h1 class="title">搜索</h1>
            </div>
        </div>
        <div class="modal-content">
            <form id="success-form">
                <input id="success-id" type="hidden" name="transId">
                <div class="weui-cells weui-cells_form">
                    <div class="weui-cell weui-cell_switch">
                        <div class="weui-cell__bd">生产令号</div>
                        <div class="weui-cell__bd" style="-webkit-box-flex: 2;-webkit-flex: 2;flex: 2;">
                            <input class="weui-footer__text" style="height: 30px;font-size: 18px;" type="text" id="queryProdNo" value=""
                                   placeholder="请输入生产令编号"/>
                        </div>
                    </div>
                    <div class="weui-cell weui-cell_switch">
                        <div class="weui-cell__bd">图号</div>
                        <div class="weui-cell__bd" style="-webkit-box-flex: 2;-webkit-flex: 2;flex: 2;">
                            <input class="weui-footer__text" style="height: 30px;font-size: 18px;" type="text" id="queryDrawNo" value=""
                                   placeholder="请输入图号"/>
                        </div>
                    </div>
                </div>
            </form>
            <div class="weui-btn-area">
                <a class="weui-btn weui-btn_primary" href="javascript:void(0);" onclick="gotoHisRec()" id="btn-query-apply">查询</a>
            </div>
        </div>
    </div>
</div>
<a id="jumpPage" style="display: none" />
<div th:include="include :: appFooter"></div>
<script th:src="@{/js/app-index.js}"></script>
<script>
    function gotoHisRec(){
        let queryProdNo = document.getElementById("queryProdNo").value;
        let queryDrawNo = document.getElementById("queryDrawNo").value;
        if(queryProdNo == ''){
            queryProdNo = 'null';
        }
        if(queryDrawNo == ''){
            queryDrawNo = 'null';
        }
        // alert(queryDrawNo);
        $("#jumpPage").attr("href",ctx+'hisRec/'+queryProdNo+"/"+queryDrawNo);
        document.getElementById("jumpPage").click();//模拟点击
    }
</script>
</body>
</html>